package cn.hamm.spms.module.open.api.test;

import cn.hamm.airpower.annotation.ApiController;
import cn.hamm.airpower.annotation.Description;
import cn.hamm.airpower.annotation.Permission;
import cn.hamm.airpower.model.Json;
import cn.hamm.airpower.open.OpenApi;
import cn.hamm.airpower.open.OpenRequest;
import cn.hamm.airpower.root.RootController;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;


/**
 * <h1>Controller</h1>
 *
 * @author Hamm.cn
 */
@ApiController("open/test")
@Description("测试API")
@Permission(login = false)
public class OpenTestController extends RootController {
    @Description("test")
    @RequestMapping("test")
    @OpenApi
    public Json test(@RequestBody @Validated OpenRequest request) {
        return Json.data(request.parse(OpenTestModel.class));
    }
}
